<?php
Yii::import('zii.widgets.CPortlet');

class UserPanel extends CPortlet
{
	public function init()
	{
		$this->title='UserPanel';
		parent::init();
	}
	
	protected function renderContent()
	{
	  //get all Nums
	  $todayTotalNum = Equation::model()->getTodayQuestionNum();
	  $todayRightNum = Equation::model()->getTodayRightNum();
	  $todayWrongNum = $todayTotalNum-$todayRightNum;
	  
	  //get user money
	  $curMoney = User::model()->getUserMonty();
	  
	  
		$this->render('userPanel',array(
		    'todayTotalNum'=>$todayTotalNum,
		    'todayRightNum'=>$todayRightNum,
		    'todayWrongNum'=>$todayWrongNum,
		
		    'curMoney'=>$curMoney,
		));
	}
}